import { Navigate } from "react-router-dom";

import About from "../pages/About.jsx";
import Home from "../pages/Home.jsx";
import Message from "../pages/Message.jsx";
import News from "../pages/News.jsx";
import Detail from "../pages/Detail.jsx";

export default [
    {
        path:"/about",
        element:<About />
    },
    {
        path:"/home",
        element:<Home />,
        children:[
            {
                path:"news",
                element:<News />
            },
            {
                path:"message",
                element:<Message />,
                children:[
                    {
                        // path:"detail/:id/:title/:content", //params传参
                        path:"detail", //search传参
                        element:<Detail />
                    }
                ]
            },
            {
                path:"",
                element:<Navigate to="news" />
            }
        ]
    },
    {
        path:"/",
        element:<Navigate to="/about" />
    }
];